#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableHeroUpgradeWeightDao:DaoBase<TableHeroUpgradeWeight>
    {
        public override string GetFileName()
        {
            return "TableHeroUpgradeWeight.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableHeroUpgradeWeight>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableHeroUpgradeWeight model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableHeroUpgradeWeight->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableHeroUpgradeWeight ParseRowData(string[] rowData)
        {
            TableHeroUpgradeWeight data = new TableHeroUpgradeWeight();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.level = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.itemOrder = rowData[2];
            }
            return data;
        }
    }
}
